package com.example.entity;

public class Teacher {
    private String name;
    private String subject;

    public Teacher() {
        this.name = "Default Teacher";
        this.subject = "Mathematics";
        System.out.println("Teacher no-arg constructor called");
    }

    public Teacher(String name, String subject) {
        this.name = name;
        this.subject = subject;
        System.out.println("Teacher parameterized constructor called: " + name + ", " + subject);
    }

    public void teach() {
        System.out.println(name + " is teaching " + subject);
    }

    public String evaluateStudent(String studentName, int score) {
        String evaluation = studentName + " got " + score + " points in " + subject + ". ";
        if (score >= 60) {
            evaluation += "Passed!";
        } else {
            evaluation += "Failed!";
        }
        return evaluation;
    }

    public static void showSchoolInfo() {
        System.out.println("Welcome to Java Reflection School!");
    }

    // Getter and Setter methods
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    @Override
    public String toString() {
        return "Teacher{name='" + name + "', subject='" + subject + "'}";
    }
}